import axios from 'axios';
export const GET_LIST_DATA = 'info/get_list_data'; //秘钥

export const loadListData = (res) => {
  return {
    type: GET_LIST_DATA,
    res
  }
}
export const loadListDataAsyanc = (dispatch) => {
  //   console.log('ok')
  //   callback({type:'xxx'})
  return () => {
    //https://m.juooo.com/home/getSildeList?abbreviation=&limit=&&version=5.1.4&referer=2

    axios({
      method: 'get',
      url: '/apis/home/getRecommendShow',
      data: {
        cityAdd: "",
        page: "2",
        version: "5.1.4",
        referer: "2"
      }
    }).then((res) => {
      //   console.log(res.data.data.recommend_show_list)
      dispatch(loadListData(res.data.data.recommend_show_list)) //返回的只有函数和对象两种
    });
    // axios({
    //   method: "get",
    //   url: "/apis/home/getSildeList",
    //   data: {
    //     city_abb: '',
    //     city_id: '0',
    //     limit: '',
    //     abbreviation: '',
    //     version: "5.1.4",
    //     referer: "2"
    //   }
    // }).then((res) => {
    //     console.log(res)
    //   dispatch(loadListData(res)) //返回的只有函数和对象两种

    // });
  }

}